<#include "common/templet.html"/> <@layout>
<div class="container">
	<div class="row">
		<div class="page-header">
			<h2 class="sub-header">
				新三大目录以及限制性用药药品编码表
			</h2>
			<div>
				<form class="form-inline" action="${ctx!}/admin/list" method="post">
				  <div class="form-group">
				    <input type="text" class="form-control" name="code"  value="${code!}" placeholder="编码">
				  </div>
				  <div class="form-group">
				    <input type="text" class="form-control"  name="name" value="${name!}" placeholder="名称">
				  </div>
				  <button type="submit" class="btn btn-primary">查 询</button>
				  <#if currentUser.role??&&currentUser.role='管理员'>
				  <button type="button" class="btn btn-warning" data-toggle="modal" data-target="#three">导入三大目录药品</button>
				  <button type="button" class="btn btn-warning"  data-toggle="modal" data-target="#limit">导入限制性药品</button>
				  <a  href="${ctx!}/admin/exportThree"  class="btn btn-success" >导出三大目录药品</a>
				  <a  href="${ctx!}/admin/exportLimit" class="btn btn-success" >导出限制性药品</a>
				  </#if>
				</form>
			</div>
		</div>
		

		<div class="modal fade" id="three" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		  <div class="modal-dialog" role="document">
		  	<form action="${ctx!}/admin/importThree" method="post" enctype="multipart/form-data">
			    <div class="modal-content">
			      <div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        <h4 class="modal-title" id="myModalLabel">选择三大项目药品Excel导入，导入后会删除原有数据</h4>
			      </div>
			      <div class="modal-body">
							<input type="file" name="file"/>		      		
			      </div>
			      <div class="modal-footer">
			        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
			        <button type="submit" class="btn btn-primary">确定导入</button>
			      </div>
			    </div>
		    </form>
		  </div>
		</div>
		
		<div class="modal fade" id="limit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		  <div class="modal-dialog" role="document">
		  <form action="${ctx!}/admin/importLimit" method="post" enctype="multipart/form-data">
			    <div class="modal-content">
			      <div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        <h4 class="modal-title" id="myModalLabel">限制性用药药品Excel导入，导入后会删除原有数据</h4>
			      </div>
			      <div class="modal-body">
						<input type="file" name="file"/>		      		
			      </div>
			      <div class="modal-footer">
			        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
			        <button type="submit" class="btn btn-primary">确定导入</button>
			      </div>
			    </div>
		    </form>
		  </div>
		</div>
		<div class="table-responsive">
			<table class="table table-bordered">
				<thead>
					<tr>
						<th colspan="18" style="text-align: center">新三大目录药品编码表</th>
						<th colspan="7" style="text-align: center">限制性用药药品编码表</th>
					</tr>
					<tr>
						<th>序号</th>
						<th>医疗项目编码</th>
						<th>医疗项目名称</th>
						<th>医疗项目分类</th>
						<th>报销等级</th>
						<th>单价</th>
						<th>单位</th>
						<th>规格</th>
						<th>剂型</th>
						<th>自费比例</th>
						<th>限价标志</th>
						<th>最高限价</th>
						<th>省级限价</th>
						<th>市级限价</th>
						<th>县级限价</th>
						<th>乡级限价</th>
						<th>不合理费用标志</th>
						<th>备注</th>
						<th>项目代码</th>
						<th>中文名称</th>
						<th>分类</th>
						<th>剂型</th>
						<th>限制</th>
						<th>备注</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<#if page??>
					<#list page.getList() as m>
					<tr>
						<td>${m_index+1}</td>
						<td>${m.code!}</td>
						<td>${m.name! }</td>
						<td>${m.type! }</td>
						<td>${m.payedGrade! }</td>
						<td>${m.price!}</td>
						<td>${m.unit!}</td>
						<td>${m.standard!}</td>
						<td>${m.reagentType! }</td>
						<td>${m.selfPercent! }</td>
						<td>${m.limitPrice! }</td>
						<td>${m.heightLimitPrice! }</td>
						<td>${m.provinceLimitPrice! }</td>
						<td>${m.cityLimitPrice! }</td>
						<td>${m.countyLimitPrice! }</td>
						<td>${m.villageLimitPrice! }</td>
						<td>${m.bedPrice! }</td>
						<td>${m.remark! }</td>
						
						<td>${m.limitCode!}</td>
						<td>${m.limitName! }</td>
						<td>${m.limitType! }</td>
						<td>${m.limitReagentType!}</td>
						<td>${m.limitLimit! }</td>
						<td>${m.limitRemark! }</td>
						<td>
							<#if currentUser.role??&& currentUser.role =='管理员'>
								<#if m.code??>
									<a
										href="${ctx!}/admin/edit?code=${m.code}"
										title="编辑">
										<span >编辑</span>
									</a>
								<#else>
									<a
										href="${ctx!}/admin/edit?code=${m.limitCode}"
										title="编辑">
										<span >编辑</span>
									</a>
								</#if>
							</#if>	
						</td>
					</tr>
					</#list>
					</#if>
				</tbody>
			</table>
		</div>
		<#if page??>
		<#include "common/_paginate.html" />
		<@paginate currentPage=page.pageNumber totalPage=page.totalPage actionUrl="${ctx!}/admin/list?pageNumber=" urlParas="${urlParam}" totalNum=page.totalRow />
		</#if>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$("#btnAdd").click(function(){
			window.location.href="${ctx}/admin/appuser/edit";
		})
		
	});
	
</script>
</@layout>
